/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes.client.editor.model.messages;

import java.io.Serializable;
import java.util.Collection;
import java.util.Calendar;
import offset.nodes.client.model.ServerResponse;
import offset.nodes.client.model.CommentedUserRequest;

public class UploadPage {
    
    /**
     *
     * @author Walter Lütgenau
     */
    public static class Request extends CommentedUserRequest implements Serializable {
        private String path;
        private String text;
        private String html;
        private Collection images;
        private Collection dataMappings;
        private Calendar lastModified;
        private boolean commit = true;
        
        /** Creates a new instance of UploadPage */
        public Request() {
            lastModified = Calendar.getInstance();
        }
        
        public String getText() {
            return text;
        }
        
        public void setText(String text) {
            this.text = text;
        }
        
        public String getHtml() {
            return html;
        }
        
        public void setHtml(String html) {
            this.html = html;
        }
        
        public Collection getImages() {
            return images;
        }
        
        public void setImages(Collection images) {
            this.images = images;
        }
        
        public String getPath() {
            return path;
        }
        
        public void setPath(String path) {
            this.path = path;
        }
        
        public Calendar getLastModified() {
            return lastModified;
        }
        
        public void setLastModifed(Calendar lastModified) {
            this.lastModified = lastModified;
        }
        
        public Collection getDataMappings() {
            return dataMappings;
        }
        
        public void setDataMappings(Collection dataMappings) {
            this.dataMappings = dataMappings;
        }

        public boolean isCommit() {
            return commit;
        }

        public void setCommit(boolean commit) {
            this.commit = commit;
        }

    }
    
    /**
     *
     * @author Walter Lütgenau
     */
    public static class Response extends ServerResponse {
        public static final int RESULT_SUCCESS = 1;
        public static final int RESULT_CONCURRENT_MODIFICATION = 2;
        private int result;
        
        public Response(int result) {
            super(result);
        }
        
        public int getResult() {
            return result;
        }
        
        public void setResult(int result) {
            this.result = result;
        }
        
    }
    
}
